package com.byx.chatclient.im;

import com.byx.chatclient.entity.message.Message;
import com.byx.chatclient.entity.message.MsgSendStatus;
import com.byx.chatclient.entity.message.MsgType;

import java.util.UUID;

/**
 * MessageBuilder
 *
 * @author Superb
 * @date 2021/4/10 11:50
 */
public class MessageBuilder {
    public static Message getBaseSendMessage(MsgType type, String senderId, String targetId) {
        if (senderId == null || targetId == null){
            return null;
        }
        Message mMessage=new Message();
        mMessage.setMsgId(UUID.randomUUID().toString());
        mMessage.setUuid(UUID.randomUUID().toString());
        mMessage.setSenderId(senderId);
        mMessage.setTargetId(targetId);
        mMessage.setSentTime(System.currentTimeMillis());
        mMessage.setSentStatus(MsgSendStatus.SENDING);
        mMessage.setMsgType(type);
        return mMessage;
    }
}
